package hms.database;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;

import java.sql.*;

public class TestHMSDatabase {
	
	public static void main(String args[]){
	DAO testHMSDBDAO = new DAO("HMSDatabase","db_files\\", true); // points to directory HMSProject/db_files/HMSDatabase.*
	
	testHMSDBDAO.open();  // if class can recognize database, no exceptions printed to screen
	
	ResultSet rs = testHMSDBDAO.getResult("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PUBLIC';");
	
	try {
		
		while(rs.next()){
			System.out.println(rs.getObject("TABLE_NAME"));
		}
		
	} catch (SQLException e) {
		
		// TODO Auto-generated catch block
		e.printStackTrace();
		
	}
	
	testHMSDBDAO.close();
	}
}
